package cn.exrick.xboot.factory.dataScope;

import cn.exrick.xboot.base.XbootBaseEntity;
import cn.exrick.xboot.common.utils.SecurityUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: njp
 * @Date: 2020/09/14/10:23
 * @Description:
 */
@Service
public class DataScopeFactory {
    @Autowired
    private SecurityUtil securityUtil;
    public  void dataScopeSet(LambdaQueryWrapper queryWrapper, R column){
        //获取权限
        List<String> deparmentIds = securityUtil.getDeparmentIds();
        queryWrapper.in(column,deparmentIds);
    }
}
